package com.exchange.b;

import android.graphics.drawable.Drawable;
import org.json.JSONException;
import org.json.JSONObject;

public class a
{
  public static final int A = 1;
  public static final int B = 0;
  public static final int C = 4;
  public static final int D = 2;
  public static final int E = 5;
  public static final int F = 4;
  public static final int G = 2;
  public static final int H = 1;
  public static final int I = 3;
  public static final int J = 0;
  public static final int K = -1;
  public static final int z = 3;
  public String a;
  public String b;
  public Drawable c = null;
  public int d = -1;
  public String e = null;
  public Drawable f = null;
  public String g = null;
  public String h;
  public String i;
  public String j;
  public double k;
  public String l;
  public int m;
  public long n;
  public Drawable o;
  public long p = -1L;
  public boolean q = false;
  public int r;
  public String s;
  public String t;
  public String u = "";
  public int v;
  public String w;
  public Drawable x;
  public String y;

  public a(String paramString1, String paramString2, String paramString3, long paramLong, String paramString4, int paramInt)
  {
    this.g = paramString1;
    this.a = paramString2;
    this.b = paramString3;
    this.n = paramLong;
    this.y = paramString4;
    this.d = paramInt;
  }

  public static a a(JSONObject paramJSONObject)
  {
    a locala = new a();
    try
    {
      String str;
      if (paramJSONObject.has("title"))
        locala.g = paramJSONObject.getString("title");
      if (paramJSONObject.has("ad_words"))
        locala.a = paramJSONObject.getString("ad_words");
      if (paramJSONObject.has("description"))
        locala.b = paramJSONObject.getString("description");
      if (paramJSONObject.has("promoter"))
        locala.j = paramJSONObject.getString("promoter");
      if (paramJSONObject.has("category"))
        locala.l = paramJSONObject.getString("category");
      if (paramJSONObject.has("size"))
        locala.n = paramJSONObject.getLong("size");
      if (paramJSONObject.has("price"))
        locala.t = paramJSONObject.getString("price");
      if (paramJSONObject.has("provider"))
        locala.u = paramJSONObject.getString("provider");
      if (paramJSONObject.has("app_package_name"))
        locala.s = paramJSONObject.getString("app_package_name");
      if (paramJSONObject.has("landing_type"))
        locala.r = paramJSONObject.getInt("landing_type");
      if (paramJSONObject.has("img"))
        locala.w = com.exchange.Public.ExchangeConstants.BASE_URL_LIST[0] + paramJSONObject.getString("img");
      if (paramJSONObject.has("display_type"))
        locala.m = paramJSONObject.getInt("display_type");
      if (paramJSONObject.has("url"))
      {
        str = paramJSONObject.getString("url");
        if ((locala.r != 2) && (locala.r != 3) && (locala.r != 4))
          break label374;
        locala.h = str;
      }
      if (paramJSONObject.has("icon"))
        locala.e = com.exchange.Public.ExchangeConstants.BASE_URL_LIST[0] + paramJSONObject.getString("icon");
      if (paramJSONObject.has("bid"))
        locala.k = paramJSONObject.getDouble("bid");
      locala.i = paramJSONObject.optString("url_in_app");
      break label408:
      label408: label374: locala.h = com.exchange.Public.ExchangeConstants.BASE_URL_LIST[0] + str;
    }
    catch (JSONException localJSONException)
    {
      localJSONException.printStackTrace();
      return locala;
    }
  }

  public long a()
  {
    return this.p;
  }
}